import 'package:efood_multivendor/helper/route_helper.dart';
import 'package:efood_multivendor/util/styles.dart';
import 'package:efood_multivendor/view/screens/home/home_screen.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../../controller/splash_controller.dart';

class GuestButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TextButton(
      style: TextButton.styleFrom(
        minimumSize: Size(1, 40),
      ),
      onPressed: () {
        Get.find<SplashController>().loadData(false);
        Navigator.pushReplacementNamed(
            context, RouteHelper.getInitialRoute("SplashScreen"));
      },
      child: RichText(
          text: TextSpan(children: [
        TextSpan(
            text: '${'continue_as'.tr} ',
            style: sfRegular.copyWith(color: Theme.of(context).disabledColor)),
        TextSpan(
            text: 'guest'.tr,
            style: sfMedium.copyWith(
                color: Theme.of(context).textTheme.bodyMedium?.color)),
      ])),
    );
  }
}
